<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/config.inc.php');
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/top.inc.php');

$building_id = mysql_real_escape_string(strip_tags($_GET['bid']));
$closing_id = mysql_real_escape_string(strip_tags($_GET['id']));
$classroom_id = mysql_real_escape_string(strip_tags($_GET['cid']));

$get_building_data = mysql_query("SELECT * FROM buildings WHERE id = $building_id");
$building_name = mysql_result($get_building_data,0,'building_name');
$abbreviation = mysql_result($get_building_data,0,'abbreviation');

$get_classroom_data = mysql_query("SELECT * FROM classrooms WHERE id = $classroom_id");
$room_num = mysql_result($get_classroom_data,0,'room_num');

$query = "SELECT * FROM classroom_closings cc JOIN days ON days.id = cc.day_id WHERE classroom_closing_id ='$closing_id'";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
$day_name = $row['day_name'];
$start_time = $row['start_time'];
$end_time = $row['end_time'];

echo "<p>";
	echo "<a href='index.php?bid=$building_id&id=$classroom_id'>&lt;&lt; Back to Closings Portal</a><br />";
echo "</p>";
echo "<h1>Delete Classroom Closing for $abbreviation $room_num</h1>";

echo "<p>";
echo "Are you sure you want to delete this classroom closing:</p>";

echo "<p><strong>$day_name, ".date('g:ia', strtotime($start_time))." - ".date('g:ia', strtotime($end_time))."</strong></p>";

echo "<form action='delete_do.php' method='post'>";
echo "<input type='hidden' name='bid' value='$building_id'>";
echo "<input type='hidden' name='id' value='$closing_id'>";
echo "<input type='hidden' name='cid' value='$classroom_id'>";
echo "<input type='submit' value='Yes'>";
echo '</form>';




?>
<?php
	require_once($_SERVER['DOCUMENT_ROOT'].'uno-course-scheduler/include/bottom.inc.php');
?>